package com.erlin.common.validator.constraints;

import com.erlin.common.validator.validators.RangesValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @date 2021/5/31 9:55 下午
 * @Author alin
 * 用于校验参数的注解  只适用于int[]
 */
@Documented
@Constraint(validatedBy = {RangesValidator.class})
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Ranges {
    String message() default "{param.range.invalid}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    int[] ranges() default {};

    String[] contains() default {};
}
